package com.hcss.core.common.logsmgt.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.hcss.core.util.DateUtil;


/** 
 * @ClassName: LoginLog 
 * @Description: TODO 登陆日志
 * @author lvfang
 * @date 2013-12-9 下午4:42:26 
 *  
 */
@SuppressWarnings("serial")
@Entity(name="t_loginLog")
public class LoginLog implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(nullable=false)
	private Integer id;
	
	@Column(name="loginTime",nullable=false)
	@Temporal(TemporalType.TIMESTAMP)
	private Date loginTime;
	
	@Transient
	private String loginTimeStr;
	
	@Column(name="loginType",nullable=false)
	private String loginType;
	
	@Column(name="userId",nullable=false)
	private int userId;
	
	@Column(name="loginIp",nullable=false)
	private String loginIp;
	
	@Transient
	private String userName;
	
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Date getLoginTime() {
		return loginTime;
	}
	public void setLoginTime(Date loginTime) {
		this.loginTime = loginTime;
	}
	public String getLoginType() {
		return loginType;
	}
	public void setLoginType(String loginType) {
		this.loginType = loginType;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getLoginIp() {
		return loginIp;
	}
	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}
	/**
	 * @return the loginTimeStr
	 */
	public String getLoginTimeStr() {
		loginTimeStr = DateUtil.dateToString(this.getLoginTime(), DateUtil.FORMAT_ONE);
		return loginTimeStr;
	}
	/**
	 * @param loginTimeStr the loginTimeStr to set
	 */
	public void setLoginTimeStr(String loginTimeStr) {
		this.loginTimeStr = loginTimeStr;
	}
	
}
